-Add blank lines to break up chunks of code to make it easier to read
-Increase code efficiency by merging multiple variables into one vector
| Code | Meaning |
|---|---|
+ |
Add |
- |
Subtract |
/ |
Divide |
* |
Multiply |
^ |
Power |
Inf |
Infinite |
NaN |
Not A Number |
NA |
Not Available |
c() |
Combine multiple variables into one vector |
[x] |
Pull out specific value from vector |
"" |
Create character vectors |
as.factor(x) |
Converts variable names into factors |
== |
Equal to |
!= |
Not equal to |
< |
Less than |
> |
More than |
<= |
Less than or equal to |
>= |
More than or equal to |
| |
Or |
%in% |
Within |
& |
To combine multiple logical operators |
Allows specifying multiple arguments within one custom made function if placed within {} brackets
mm <- function(x){
##sort vector from smallest to largest
##retrieve first and last value in vector
MINMAX <- sort(x)[c(1,length(x))]
##add `return()` to give wanted value
return(MINMAX)
}
To insert images you must have the image saved in same folder as RMarkdown file
<center>  </center>
<center> before centers the image/object and </center> after stops that